# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2ConversationTelephonyConnectionInfo do
  @moduledoc """
  The information about phone calls connected via phone gateway to the conversation.

  ## Attributes

  *   `dialedNumber` (*type:* `String.t`, *default:* `nil`) - Output only. The number dialed to connect this call in E.164 format.
  *   `extraMimeContents` (*type:* `list(GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2ConversationTelephonyConnectionInfoMimeContent.t)`, *default:* `nil`) - Output only. The mime content from the initial SIP INVITE.
  *   `sdp` (*type:* `String.t`, *default:* `nil`) - Optional. SDP of the call. It's initially the SDP answer to the endpoint, but maybe later updated for the purpose of making the link active, etc.
  *   `sipHeaders` (*type:* `list(GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2ConversationTelephonyConnectionInfoSipHeader.t)`, *default:* `nil`) - Output only. The SIP headers from the initial SIP INVITE.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dialedNumber => String.t() | nil,
          :extraMimeContents =>
            list(
              GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2ConversationTelephonyConnectionInfoMimeContent.t()
            )
            | nil,
          :sdp => String.t() | nil,
          :sipHeaders =>
            list(
              GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2ConversationTelephonyConnectionInfoSipHeader.t()
            )
            | nil
        }

  field(:dialedNumber)

  field(:extraMimeContents,
    as:
      GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2ConversationTelephonyConnectionInfoMimeContent,
    type: :list
  )

  field(:sdp)

  field(:sipHeaders,
    as:
      GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2ConversationTelephonyConnectionInfoSipHeader,
    type: :list
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2ConversationTelephonyConnectionInfo do
  def decode(value, options) do
    GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2ConversationTelephonyConnectionInfo.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2ConversationTelephonyConnectionInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
